package com.snowwolf.trade.base;

import lombok.Data;

/**
 * @author: snowwolf
 * @description:
 * @date: Create in 2019/2/25 9:59
 * @modified by:
 * @versions：0.1.0
 */
@Data
public class RestResponse<T> {
    private String exceptCauseIp;
    private String exceptCauseApp;
    private String exceptClass;
    private String resultCode;
    private String resultMsg;
    private T data;
    public static final RestResponse SUCCESS = new RestResponse();
    public static final RestResponse FAIL = new RestResponse("100000", "fail");

    public RestResponse() {
        this((T) null);
    }

    public RestResponse(T data) {
        this.resultCode = "0";
        this.resultMsg = "success";
        this.data = data;
    }

    public RestResponse(String resultCode, String resutMessage) {
        this.resultCode = resultCode;
        this.resultMsg = resutMessage;
    }

    public RestResponse(String resultCode, String resutMsg, T data) {
        this.resultCode = resultCode;
        this.resultMsg = resutMsg;
        this.data = data;
    }
}
